<?xml version="1.0" encoding="utf-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
	xmlns:ogc="http://www.opengis.net/ogc" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd
                      http://www.opengis.net/ogc http://schemas.opengis.net/filter/1.1.0/expr.xsd">
	
	<namespaces>
		<Namespace>
			<prefix>gsml</prefix>
			<uri>urn:cgi:xmlns:CGI:GeoSciML:2.0</uri>
		</Namespace>
		<Namespace>
			<prefix>gwml</prefix>
			<uri>http://www.nrcan.gc.ca/xml/gwml/1</uri>
		</Namespace>
		<Namespace>
			<prefix>gml</prefix>
			<uri>http://www.opengis.net/gml</uri>
		</Namespace>
		<Namespace>
			<prefix>xlink</prefix>
			<uri>http://www.w3.org/1999/xlink</uri>
		</Namespace>
	</namespaces>
	<sourceDataStores>
		<DataStore>
			<id>datastore</id>
			<parameters>
				<Parameter>
					<name>directory</name>
					<value>file:./</value>
				</Parameter>
			</parameters>
		</DataStore>
	</sourceDataStores>
	<targetTypes>
		<FeatureType>
			<schemaUri>HydrogeologicUnit.xsd</schemaUri>
		</FeatureType>
	</targetTypes>
	<typeMappings>

		<FeatureTypeMapping>
			<sourceDataStore>datastore</sourceDataStore>
			<sourceType>mappedinterval</sourceType>
			<targetElement>gwml:HydrostratigraphicUnit</targetElement>
			<mappingName>Aquifer</mappingName>
			<groupBy/>
			<attributeMappings>
				<AttributeMapping>
					<targetAttribute>gwml:HydrostratigraphicUnit</targetAttribute>
					<idExpression>
						<OCQL>strConcat('ubspatial.hydrostratigraphicunit.', MAPPED_INTERVAL_ID)</OCQL>						
					</idExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gml:description</targetAttribute>
					<sourceExpression>
						<OCQL>INTERVAL_DESCRIPTION</OCQL>
					</sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gml:name</targetAttribute>
					<sourceExpression>
						<OCQL>strConcat('http://maps.ubspatial.com.au/resource/hydrostratigraphicunit/hydrostratigraphicunit.', MAPPED_INTERVAL_ID)</OCQL>
					</sourceExpression>
					<ClientProperty>
						<name>codeSpace</name>
						<value>'borehole.codespace1'</value>
					</ClientProperty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gsml:observationMethod/gsml:CGI_TermValue/gsml:value</targetAttribute>
					<sourceExpression>
						<OCQL>'http://www.opengis.net/def/nil/OGC/0/unknown'</OCQL>
					</sourceExpression>
					<ClientProperty>
						<name>codeSpace</name>
						<value>'borehole.codespace1'</value>
					</ClientProperty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gsml:purpose</targetAttribute>
					<sourceExpression>
						<OCQL>'instance'</OCQL>
					</sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gsml:occurrence</targetAttribute>
					<ClientProperty>
						<name>xlink:href</name>
						<value>strConcat('#', MAPPED_INTERVAL_ID)</value>
					</ClientProperty>
				</AttributeMapping>
				</attributeMappings>
		</FeatureTypeMapping>
		<FeatureTypeMapping>
			<sourceDataStore>datastore</sourceDataStore>
			<sourceType>mappedinterval</sourceType>
			<targetElement>gwml:HydrostratigraphicUnit</targetElement>
			<mappingName>Lithology</mappingName>
			<groupBy/>
			<attributeMappings>
				<AttributeMapping>
					<targetAttribute>gwml:HydrostratigraphicUnit</targetAttribute>
					<idExpression>
						<OCQL>strConcat('ubspatial.hydrostratigraphicunit.', MAPPED_INTERVAL_ID)</OCQL>
					</idExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gml:description</targetAttribute>
					<sourceExpression>
						<OCQL>INTERVAL_DESCRIPTION</OCQL>
					</sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gml:name</targetAttribute>
					<sourceExpression>
						<OCQL>strConcat('http://maps.ubspatial.com.au/resource/hydrostratigraphicunit/hydrostratigraphicunit.', MAPPED_INTERVAL_ID)</OCQL>
					</sourceExpression>
					<ClientProperty>
						<name>codeSpace</name>
						<value>'borehole.codespace1'</value>
					</ClientProperty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gsml:observationMethod/gsml:CGI_TermValue/gsml:value</targetAttribute>
					<sourceExpression>
						<OCQL>'http://www.opengis.net/def/nil/OGC/0/unknown'</OCQL>
					</sourceExpression>
					<ClientProperty>
						<name>codeSpace</name>
						<value>'borehole.codespace1'</value>
					</ClientProperty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gsml:purpose</targetAttribute>
					<sourceExpression>
						<OCQL>'instance'</OCQL>
					</sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gsml:occurrence</targetAttribute>
					<ClientProperty>
						<name>xlink:href</name>
						<value>strConcat('#', MAPPED_INTERVAL_ID)</value>
					</ClientProperty>
				</AttributeMapping>
				</attributeMappings>
		</FeatureTypeMapping>
	</typeMappings>
</as:AppSchemaDataAccess>
